package org.springside.examples.miniweb.service.dictionary;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import org.springside.examples.miniweb.entity.dictionary.DictionaryDetail;
import org.springside.examples.miniweb.dao.dictionary.DictionaryDetailDao;
import org.springside.modules.orm.Page;
import org.springside.modules.orm.PropertyFilter;

@Service
@Transactional
public class DictionaryDetailManager {
	@Autowired
	private DictionaryDetailDao dictionaryDetailDao;

	// DictionaryDetail Manager //
	@Transactional(readOnly = true)
	public DictionaryDetail getDictionaryDetail(Long id) {
		return dictionaryDetailDao.get(id);
	}

	@Transactional(readOnly = true)
	public List<DictionaryDetail> getAllDictionaryDetail() {
		return dictionaryDetailDao.getAll();
	}
	
	@Transactional(readOnly = true)
	public Page<DictionaryDetail> searchDictionaryDetail(final Page<DictionaryDetail> page, final List<PropertyFilter> filters) {
		return dictionaryDetailDao.findPage(page, filters);
	}	
	
	public void saveDictionaryDetail(DictionaryDetail dictionaryDetail) {
		dictionaryDetailDao.save(dictionaryDetail);
	}

	public void deleteDictionaryDetail(Long id) {
		dictionaryDetailDao.delete(id);
	}
}

